import java.util.*;
public class Main{
    public static void reverse(char[] array,int start,int end) {
        while(start < end) {

            char tmp = array[start];
            array[start] = array[end];
            array[end] = tmp;

            start++;
            end--;
        }
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        char[] ch = s.toCharArray();
        int len = ch.length;
//1、整体进行了逆置
        reverse(ch,0,len-1);
        int i = 0;//遍历ch数组
        while( i < len ) {
            int j = i;
            while(j < len && ch[j] != ' ') {
                j++;
            }
            if(j < len) {
                reverse(ch,i,j-1);
                i = j+1;
            }else{
                reverse(ch,i,j-1);
                i = j;
            }
        }
        String str = new String(ch);
        System.out.println(str);
    }
}